package com.zy.springboot.condition;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class OracleDBCondition implements Condition {
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        try{
            conditionContext.getClassLoader().loadClass("oracle.jdbc.driver.OracleDriver");
            return  true;
        }catch (ClassNotFoundException e){
            return false;
        }

    }
}
